import streamlit as st
import base64
#页面设计
def main_bg(main_bg):
    main_bg_ext = "jpg"
    st.markdown(
        f"""
         <style>
         .stApp {{
             background: url(data:image/{main_bg_ext};base64,{base64.b64encode(open(main_bg, "rb").read()).decode()});
             background-size: cover
         }}
         </style>
         """,
        unsafe_allow_html=True)
main_bg('login.jpg')

#会发光的字体
st.write("""
<style>
.neon-glow {
    font-size: 50px;
    color: #fff;
    text-shadow: 0 0 10px #FFBBFF, 0 0 20px #FFBBFF, 0 0 30px #FFBBFF, 0 0 40px #FFBBFF, 0 0 70px #FFBBFF, 0 0 80px #FFBBFF, 0 0 100px #FFBBFF, 0 0 150px #FFBBFF;
    animation: glow 1s ease-in-out infinite alternate-reverse;
}

@keyframes glow {
    to {
        text-shadow: 0 0 5px #FFBBFF, 0 0 10px #FFBBFF, 0 0 15px #FFBBFF, 0 0 20px #FFBBFF, 0 0 35px #FFBBFF, 0 0 40px #FFBBFF, 0 0 50px #FFBBFF, 0 0 75px #FFBBFF;
    }
}
</style>
""", unsafe_allow_html=True)

st.markdown('<p class="neon-glow">💕请选择你想要的男朋友💕</p >', unsafe_allow_html=True)

if "xingge" not in st.session_state:
    st.session_state.xingge = ""
#按钮1
col1,col2 = st.columns(2)
with col1:
    image_url1="https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2022%2F0609%2Fb0d81b01j00rd79hj00hqc000hs00npc.jpg&thumbnail=660x2147483647&quality=80&type=jpg"
    st.image(image_url1,width=150)
    bt1  = st.button("霸道总裁")
    if bt1:
        st.session_state.xingge = "霸道总裁"
        st.switch_page("pages/cyber_boyfriend.py")
with col2:
    image_url2="https://img2.woyaogexing.com/2018/08/08/ead8a0fa2fb04bcbb5c671435f2f0a5c%21400x400.jpeg"
    st.image(image_url2, width=200)
    bt2  = st.button("小奶狗")
    if bt2:
        st.session_state.xingge = "小奶狗"
        st.switch_page("pages/cyber_boyfriend.py")

#按钮2
col1,col2 = st.columns(2)
with col1:
    image_url3="https://img2.baidu.com/it/u=588430801,608305061&fm=253&fmt=auto&app=120&f=JPEG?w=800&h=500"
    st.image(image_url3, width=190)
    bt3 = st.button("病娇")
    if bt3:
        st.session_state.xingge = "病娇"
        st.switch_page("pages/cyber_boyfriend.py")
with col2:
    image_url4="https://img1.baidu.com/it/u=1578768968,570183829&fm=253&fmt=auto&app=120&f=JPEG?w=889&h=500"
    st.image(image_url4, width=200)
    bt4 = st.button("沉默寡言")
    if bt4:
        st.session_state.xingge = "沉默寡言"
        st.switch_page("pages/cyber_boyfriend.py")

#按钮
option = st.sidebar.selectbox(
    label="请选择你想要返回的内容",
    options=("请选择","登录","重新选择模块")
    )
if option == "登录":
    st.switch_page("login.py")
if option == "重新选择模块":
    st.switch_page("pages/Intelligent-selection-interface.py")